import java.util.Scanner;
public class 质数相合一样 {
    public static void main(String[] args) {
//        Scanner in = new Scanner(System.in);
//        System.out.println("输入数字范围");
//        int num = in.nextInt();
        for (int i = 0; i < 1000; i++) {
            int count =0;
            for (int j = 1; j < i ; j++) {
                if(i%j==0){
                    count=count+j;
                }

            }if(count==i){
                System.out.println(count);

        }
        }
    }
}
